//
//  ViewManager.m
//  KEREN
//
//  Created by MW on 2023/3/15.
//

#import "ViewManager.h"

@implementation ViewManager
+ (instancetype)shareInstance {
    
    static ViewManager *manager;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[self alloc]init];
    });
    return manager;
}
-(void)setMianBackLayerForView:(UIView *)view
{
    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
    gradientLayer.colors = @[(__bridge id)Color_AAAAAA.CGColor, (__bridge id)Color_555555.CGColor];
    gradientLayer.locations = @[@0, @1.0];
    gradientLayer.frame = CGRectMake(0, 0, DEVICE_WIDTH, DEVICE_HEIGHT/2);
    gradientLayer.startPoint = CGPointMake(1, 0);
    gradientLayer.endPoint = CGPointMake(0, 1);

    
    CAGradientLayer *gradientLayers = [CAGradientLayer layer];
    gradientLayers.colors = @[(__bridge id)Color_AAAAAA.CGColor, (__bridge id)Color_555555.CGColor];;
    gradientLayers.locations = @[@0, @1.0];
    gradientLayers.frame =CGRectMake(0, DEVICE_HEIGHT/2, DEVICE_WIDTH, DEVICE_HEIGHT/2);
    gradientLayers.startPoint = CGPointMake(0, 0);
    gradientLayers.endPoint = CGPointMake(1, 1);
    [view.layer addSublayer:gradientLayer];
    [view.layer addSublayer:gradientLayers];

}
- (void)setLineBackLayerForView:(UIView *)view{
    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
    gradientLayer.colors = @[(__bridge id)rgba(1, 1, 1, 0).CGColor, (__bridge id)rgba(1, 1, 1, 0.4).CGColor,(__bridge id)rgba(1, 1, 1, 0).CGColor];
    gradientLayer.locations = @[@0, @0.52, @1.0];
    gradientLayer.frame = CGRectMake(0, 0, 1, 72);
    gradientLayer.startPoint = CGPointMake(0, 0);
    gradientLayer.endPoint = CGPointMake(0, 1);
    [view.layer addSublayer:gradientLayer];
}

@end
